<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>
    <script>
        let arr = [2, 4, 9, 6, 11, 22, 44, 66]

        //  find 找出第一个符合条件的成员 ，没找到 undefined
        let res = arr.find((val, index, arr) => {
            return val > 10
        })
        console.log(res);

        // ----------------------------------------
        // 找位置
        let arr1 = [2, 4, 9, 6, 11, 22, 44, 66]

        // findIndex 找到第一个符合条件的返回索引，没找到就返回-1
        let res1 = arr1.findIndex((val) => {
            return val > 11
        })
        console.log(res1);
    </script>

</body>

</html>